import 'package:json_annotation/json_annotation.dart';

part 'comment_request.g.dart';

@JsonSerializable()
class CommentRequest extends Object {
  @JsonKey(name: 'content')
  String content;

  @JsonKey(name: 'author')
  String author;

  @JsonKey(name: 'postId')
  int postId;

  @JsonKey(name: 'userId')
  int userId;

  @JsonKey(name: 'email')
  String email;

  @JsonKey(name: 'parentId')
  int parentId;

  CommentRequest({
    this.content,
    this.author,
    this.postId,
    this.userId,
    this.email,
    this.parentId,
  });

  factory CommentRequest.fromJson(Map<String, dynamic> srcJson) =>
      _$CommentRequestFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CommentRequestToJson(this);
}
